home *** CD-ROM | disk | FTP | other *** search
- Path: news.cencom.net!ns!tanp
- From: tanp@ns (Bill Wendling)
- Newsgroups: comp.lang.c
- Subject: Re: ATTENTION C EXPERTS!! Extern Declarations - NEED HELP!
- Date: 18 Jan 1996 06:25:06 GMT
- Organization: Cen-Com Internet
- Message-ID: <4dkp42$k1q@news.cencom.net>
- References: <DCD9516F@brazerko.com>
- NNTP-Posting-Host: ns.cencom.net
- X-Newsreader: TIN [version 1.2 PL2]
-
- tcassel inexplicably wrote:
- } I am having difficulty understanding the following code and every book I
- } get on
- } the subject does not explain the multiple MACROS that are in the
- } definition.
-
- } extern unsigned int _NEAR _CDECL _osversion;
-
- } /* where _NEAR and _CDECL are macros defined as:*/
-
- } #ifndef NO_KEYS
- } #define _CDECL cdecl
- } #define _NEAR near
- } #else
- } #define _CDECL
- } #define _NEAR
- } #endif
-
- } /* There is only two places where cdecl and near are mentioned in the rest
- } of
- } the program - the following appears once in two seperate header files */
-
- } #define _NEAR near
- } #define _CDECL cdecl
-
- } /* I am attempting to make this program ansi C compilable, and am stuck on
- } this
- } as I dont understand what the above code is doing. Any help would be
- } greatly
- } appreciated. Kind Regards, Thea Cassel tcassel@sisyphus.cit.gu.edu.au
- } */
-
- NEAR tells a 16 bit operating system that the pointer is to the current
- segment of memory. As opposed to a FAR pointer which can access another
- segment of memory. CDECL seems to be telling the program that the parameters
- are pushed in C style when being passed as opposed to Pascal which pushes
- them on the stack in a different way. (I could be wrong in CDECL, though.)
-
- Anyway, neither of these are in the K&R for good reason. C was meant to
- run on UNIX which is a real operating system, instead of DOS, which isn't.
- I've only seen these Macros used for DOS and Windoze programs.
-
- --
- Bill Wendling | "Pinky, are you thinking what I'm thinking?"
- tanp@ns.cencom.net | "I think so, Brain, but burlap chafes me so."
- "Boom Shanka" | Finger me for my Geek Code...NOW!
-